    <div class="oe_usearch">
      <h2>想查看更多符合你条件的用户？尝试一下搜索吧！</h2>
      <div class="bd">
	    <span class="text"> 搜索意中人：</span>
        <dl class="current">
          <dt f="but_selser"><em>所在地区</em> <i></i></dt>
          <dd style="width:220px;">
            <h3>选择地区</h3>
            <!--{area type='select' name='s_dist' depth='1' child='1' text='=选择=' value=$s_dist1}--> 
            -
			<b id="json_s_dist2" style="font-weight:normal;">
              <select name="s_dist2" id="s_dist2"><option value="">=选择=</option></select>
			</b>
            <div class="btn">
			  <b f="but_selrange_confirm" data-1="s_dist1" data-2="s_dist2" data-3="s_dist3" data-4="s_dist4" data-unit="" data-tips="所在地区">确定</b>
			</div>
          </dd>
        </dl>
        <dl>
          <dt f="but_selser"><em>年龄</em> <i></i></dt>
          <dd style="width:200px;">
            <h3>选择年龄</h3>
            <!--{hook mod="age" type="select" name="s_age1" text="请选择" value=$s_age1}--> -
			<!--{hook mod="age" type="select" name="s_age2" text="请选择" value=$s_age2}--> 岁
            <div class="btn">
			  <b f="but_selrange_confirm" data-1="s_age1" data-2="s_age2" data-unit="岁" data-tips="年龄">确定</b>
			</div>
          </dd>
        </dl>
		<dl>
          <dt f="but_selser"><em>身高</em> <i></i></dt>
          <dd style="width:200px;">
            <h3>选择身高</h3>
            <!--{hook mod="height" type="select" name="s_height1" text="请选择" value=$s_height1}--> -
			<!--{hook mod="height" type="select" name="s_height2" text="请选择" value=$s_height2}--> CM
            <div class="btn">
			  <b f="but_selrange_confirm" data-1="s_height1" data-2="s_height2" data-unit="CM" data-tips="身高">确定</b>
			</div>
          </dd>
        </dl>
		<dl>
          <dt f="but_selser"><em>婚况</em> <i></i></dt>
          <dd style="width:100px;">
            <h3>选择婚况</h3>
			<!--{assign var="varlist" value=vo_list("mod={volistvar} where={marry}")}-->
            <select name="s_marry" id="s_marry" f="but_sel_one" data-tips="婚况">
              <option value="">不限</option>
			  <!--{foreach $varlist as $val}-->
			  <option value="<!--{$val.value}-->"<!--{if $s_marry == $val.value}--> selected<!--{/if}-->><!--{$val.text}--></option>
			  <!--{/foreach}-->
            </select>
          </dd>
        </dl>
		<dl>
          <dt f="but_selser"><em>学历</em> <i></i></dt>
          <dd style="width:100px;">
            <h3>选择学历</h3>
            <!--{assign var="varlist" value=vo_list("mod={volistvar} where={education}")}-->
            <select name="s_education" id="s_education" f="but_sel_one" data-tips="学历">
              <option value="">不限</option>
			  <!--{foreach $varlist as $val}-->
			  <option value="<!--{$val.value}-->"<!--{if $s_education == $val.value}--> selected<!--{/if}-->><!--{$val.text}--></option>
			  <!--{/foreach}-->
            </select>
          </dd>
        </dl>
        <span class="search_btn" f="but_search_go">搜索</span>
        <div class="clear"></div>
      </div>
    </div>
	<!--//oe_usearch End-->

<script type="text/javascript">
$(function(){
	//搜索选择器
	$(document).on("click", "[f='but_selser']", function(){
		$_dd = $(this).next("dd");
		if ($_dd.css("display") == "none") {
			$(this).parent().addClass("current");
			$_dd.slideDown(100);
		}
		else {
			$(this).parent().removeClass("current");
			$_dd.slideUp(100);
		}
	});
	
	//点击空白出隐藏选择器
	$(document).on("click", function(e){
		var target1  = $(e.target);
        if(target1.closest(".oe_usearch dl").length == 0){
			$(".oe_usearch dl dd").slideUp(100);
			$(".oe_usearch dl").removeClass("current");
		}
	});

	//下拉选1项 change
	$(document).on("change", "[f='but_sel_one']", function(){
		$_val = $(this).find("option:selected").val();
		$_text = $(this).find("option:selected").text();
		$_tips_text = $(this).attr("data-tips");
		if (typeof($_tips_text) == "undefined") {
			$_tips_text = "不限";
		}
		if ($_text == "=不限=") {
			$_text = $_tips_text;
		}
		$(this).parent().prev().children("em").html($_text);
		$(this).parent().slideUp(100);
		$(this).parent().parent().removeClass("current");
	});

	//范围确定选择2项及以上
	$(document).on("click", "[f='but_selrange_confirm']", function(){
		$_val1 = $_text1 = $_val2 = $_text2 = $_val3 = $_text3 = $_val4 = $_text4 = "";
		$_data_1 = $(this).attr("data-1");
		$_data_2 = $(this).attr("data-2");

		$_data_3 = $(this).attr("data-3");
		if (typeof($_data_3) == "undefined") {
			$_data_3 = "";
		}
		$_data_4 = $(this).attr("data-4");
		if (typeof($_data_4) == "undefined") {
			$_data_4 = "";
		}
		$_data_unit = $(this).attr("data-unit");
		$_data_tips = $(this).attr("data-tips");
		if (typeof($_data_unit) == "undefined") {
			$_data_unit = "";
		}
		if (typeof($_data_tips) == "undefined") {
			$_data_tips = "";
		}

		if ($_data_1.length > 0) {
			$_val1 = parseInt($("#"+$_data_1).find("option:selected").val());
			$_text1 = $("#"+$_data_1).find("option:selected").text();
		}
		if ($_data_2.length > 0) {
			$_val2 = parseInt($("#"+$_data_2).find("option:selected").val());
			$_text2 = $("#"+$_data_2).find("option:selected").text();
		}
		
		if ($_data_3.length > 0) {
			$_val3 = parseInt($("#"+$_data_3).find("option:selected").val());
			$_text3 = $("#"+$_data_3).find("option:selected").text();
		}
		if ($_data_4.length > 0) {
			$_val4 = parseInt($("#"+$_data_4).find("option:selected").val());
			$_text4 = $("#"+$_data_4).find("option:selected").text();
		}


		if ($_val1 > 0 && $_val2 > 0) {
			$_text = $_text1+$_data_unit+"-"+$_text2+$_data_unit;

			if ($_val3 > 0) {
				$_text = $_text+"-"+$_text3+$_data_unit;
			}
			if ($_val4 > 0) {
				$_text = $_text+"-"+$_text4+$_data_unit;
			}
		}
		else {
			$_text = $_data_tips;
		}
		$(this).parent().parent().prev().children("em").html($_text);
		$(this).parent().parent().slideUp(100);
		$(this).parent().parent().parent().removeClass("current");

	});

	
	//确定搜索
	$(document).on("click", "[f='but_search_go']", function(){
		$s_dist1 = $("#s_dist1").val();
		$s_dist2 = $("#s_dist2").val();
		if (typeof($s_dist2) == "undefined") {
			$s_dist2 = 0;
		}
		$s_age1 = $("#s_age1").val();
		$s_age2 = $("#s_age2").val();
		$s_height1 = $("#s_height1").val();
		$s_height2 = $("#s_height2").val();
		$s_marry = $("#s_marry").val();
		$s_education = $("#s_education").val();
		$_url = _ROOT_PATH+"index.php?c=user&a=list&s_dist1="+$s_dist1+"&s_dist2="+$s_dist2+
				"&s_age1="+$s_age1+"&s_age2="+$s_age2+"&s_height1="+$s_height1+"&s_height2="+$s_height2+
				"&s_marry="+$s_marry+"&s_education="+$s_education;
		window.location.href = $_url;
	});

});
</script>

